package com.guguskins.back.service.impl;

import com.guguskins.back.entity.GuCommonProblem;
import com.guguskins.back.entity.vo.PageVo;
import com.guguskins.back.mapper.GuCommonProblemMapper;
import com.guguskins.back.service.GuCommonProblemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-06-02
 */
@Service
public class GuCommonProblemServiceImpl extends ServiceImpl<GuCommonProblemMapper, GuCommonProblem> implements GuCommonProblemService {

    @Autowired
    private GuCommonProblemMapper problemMapper;

    @Override
    public PageVo<GuCommonProblem> pageList(Integer pageNum, Integer pageSize) {
        PageVo<GuCommonProblem> pageVo = new PageVo<>();
        pageVo.setData(problemMapper.selectListPage(pageNum, pageSize));
        pageVo.setTotal(problemMapper.selectTotal());
        return pageVo;
    }
}
